package com.qidian.kk;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.stream.Stream;

public class StreamDemo02 {
    public static void main(String[] args) {
        Map<String, Integer> map = new HashMap<>();
        map.put("蜡笔小新", 19);
        map.put("黑子", 17);
        map.put("日向翔阳", 16);


        // 双列集合：转换成单列集合后再创建
        Stream<Map.Entry<String, Integer>> stream = map.entrySet().stream();

        Set<Map.Entry<String, Integer>> entries = map.entrySet();
        entries.stream()
                .filter((entry) -> entry.getValue() > 16)
                .forEach((entry) -> {
                    System.out.println(entry.getKey() + "---" + entry.getValue());
                });
    }
}
